package com.core.framework.spring.appcontext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.core.framework.spring.SpringAppConst;


/**
 * @author 刘涛
 * @since Jun 7, 2012
 * <a> 获取Spring上下文</a>
 */
public class SpringAppContext {

	private static SpringAppContext instance;

	private AbstractApplicationContext appContext;

	public synchronized static SpringAppContext getInstance() {
		if (instance == null) {
			instance = new SpringAppContext();
		}
		return instance;
	}

	private SpringAppContext() {
		this.appContext = new ClassPathXmlApplicationContext(
				SpringAppConst.AppConfigLocations.LOCAL_APPLICATIONCONTEXT);
		
	}
	public AbstractApplicationContext getAppContext() {
		return appContext;
	}

}
